home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.awt;
-
- import symantec.itools.db.pro.RelationView;
- import symjava.sql.SQLException;
-
- class Position {
- int frozenRecordNumber;
- int notificationMode;
- boolean frozen = false;
- RelationView relView;
- int ignoreCount;
- String name = "";
-
- Position(RelationView var1) {
- this.relView = var1;
-
- try {
- this.name = var1.getName();
- } catch (SQLException var2) {
- }
- }
-
- void freeze() throws SQLException {
- this.frozen = true;
- this.ignoreNotification(true);
- this.frozenRecordNumber = this.relView.getCurrentRecordNumber();
- this.relView.enableBindingNotify(false, true);
- this.relView.enableDetailSQL(false);
- }
-
- void thaw() throws SQLException {
- if (this.frozenRecordNumber > 0) {
- this.goTo(this.frozenRecordNumber);
- }
-
- this.relView.enableDetailSQL(true);
- this.relView.enableBindingNotify(true, true);
- this.frozen = false;
- this.ignoreNotification(false);
- }
-
- boolean set(int var1) throws SQLException {
- if (this.relView.getCurrentRecordNumber() == var1) {
- return true;
- } else {
- if (this.getNotificationMode() && !this.frozen) {
- this.freeze();
- }
-
- return this.goTo(var1);
- }
- }
-
- boolean goTo(int var1) throws SQLException {
- boolean var2 = false;
- this.ignoreNotification(true);
- var2 = this.relView.goTo(var1);
- this.ignoreNotification(false);
- return var2;
- }
-
- int get() throws SQLException {
- return this.frozen ? this.frozenRecordNumber : this.relView.getCurrentRecordNumber();
- }
-
- void setNotificationMode(boolean var1) throws SQLException {
- if (var1) {
- ++this.notificationMode;
- } else {
- --this.notificationMode;
- if (this.notificationMode == 0 && this.frozen) {
- this.thaw();
- }
-
- }
- }
-
- boolean getNotificationMode() {
- return this.notificationMode > 0;
- }
-
- void ignoreNotification(boolean var1) {
- if (var1) {
- ++this.ignoreCount;
- } else {
- --this.ignoreCount;
- }
- }
-
- int getIgnoreCount() {
- return this.ignoreCount;
- }
- }
-